A cache buffer is a high speed memory buffer inserted between a host and a storage device, such as a disk drive, to store those portions of the disk drive data currently in use. Since the cache, typically implemented as semiconductor memory, is several times faster than the disk drive, using the cache can reduce the effective disk access time. Conventionally, a firmware cache manager has controlled transfer of data into and out of the cache buffer, and has managed the data stored in the cache buffer. A typical cache manager utilizes a cache directory containing data block memory addresses, and control bits for cache management and access control. The cache manager searches the cache directory to fetch and store data blocks in the cache buffer, and uses a replacement strategy to determine which data blocks to retain in the cache buffer and which to discard.
However, a major disadvantage of existing cache managers is slow operational speed in detecting data blocks in the cache buffer. This is because the cache manager must search through the cache directory and examine the entries therein to determine if one or more requested data blocks are in the cache buffer. This is a time consuming process, typically performed by a microprocessor executing instructions requiring multiple clock cycles. As such, existing cache managers commonly search for the first of a set of consecutive data blocks, and rarely search for all the data blocks in the set.
Most cache buffers are organized into multiple segments each storing a set of data blocks. As a result, a logically consecutive set of data blocks may exist as multiple subsets stored in different cache segments. Another disadvantage of existing cache managers is that, although all the data blocks of a requested set may exist as subsets stored in different cache segments, because of their slow operational speed, existing cache managers can only search for the subset containing the first data block in the requested set. As a result, such cache managers record a partial hit and attempt to transfer the remaining subsets into the cache buffer from the disk drive. This is a very time consuming task that causes replacement of existing, and most likely useful, data blocks, wastes precious cache buffer space, and prevents seamless delivery of the requested consecutive data blocks to the host.
Yet another disadvantage of existing cache managers is their inability to effectively buffer data from the host. Every time the host issues a write command, the cache manager is interrupted to store data from the host into the cache buffer and communicate with the disk drive. As such, there is little or no parallelism between the host and the cache manager in handling data. Further, the cache manager must take the time to execute its replacement strategy to store the data into the cache buffer and keep the cache directory coherent. As multiple write commands are issued by the host, existing cache managers have no ability to buffer the data, and keep the cache coherent, without multiple interruptions.
There is, therefore, a need for a method of managing a cache buffer which quickly, and efficiently, detects data in the cache buffer. There is also a need for such a method to quickly, and efficiently retrieve data stored in the cache buffer. There is also a need for such a method to quickly, and efficiently, buffer multiple data transfers into the cache buffer. There is also a need for an improved cache manager architecture embedded within a random access mass storage device, such as a hard disk drive.